import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:moose_app/core/utils/navigate_util.dart';
import 'package:moose_app/ui/screens/order/order_screen.dart';
import 'package:moose_app/ui/values/colors.dart';
import 'package:moose_app/ui/values/constants.dart';
import 'package:moose_app/ui/widgets/common/common_right_arrow.dart';

class ATHMimeOrderTipInfo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: kCommonBoxDecoration,
      margin:
          EdgeInsets.symmetric(horizontal: kSize20).copyWith(bottom: kSize20),
      padding: EdgeInsets.symmetric(vertical: kSize20),
      child: Column(
        children: <Widget>[
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Padding(
                padding: EdgeInsets.only(left: kSize24),
                child: Text(
                  "我的订单",
                  style: TextStyle(color: kColor33, fontSize: kFontSize32),
                ),
              ),
              GestureDetector(
                onTap: () {
                  print("ATHOrderScreen");
                },
                child: GestureDetector(
                  onTap: () {
                    ATHNavigator.pushFromRight(
                        context, ATHOrderScreen.routeName);
                  },
                  child: Padding(
                    padding: EdgeInsets.only(right: kSize24),
                    child: Row(
                      children: <Widget>[
                        Text(
                          "查看全部订单",
                          style:
                              TextStyle(color: kColor99, fontSize: kFontSize26),
                        ),
                        ATHCommonRightArrow()
                      ],
                    ),
                  ),
                ),
              )
            ],
          ),
          Divider(),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: <Widget>[
              ATHMimeOrderDescItem(
                desc: "待付款",
                icon: "assets/icons/order/icon_daifukuang.svg",
              ),
              ATHMimeOrderDescItem(
                desc: "待发货",
                icon: "assets/icons/order/icon_daifahuo.svg",
              ),
              ATHMimeOrderDescItem(
                desc: "待收货",
                icon: "assets/icons/order/icon_daishouhuo.svg",
              ),
              ATHMimeOrderDescItem(
                desc: "待评价",
                icon: "assets/icons/order/icon_daipingjia.svg",
              ),
              ATHMimeOrderDescItem(
                desc: "退款/售后",
                icon: "assets/icons/order/icon_tuikuang.svg",
              )
            ],
          )
        ],
      ),
    );
  }
}

class ATHMimeOrderDescItem extends StatelessWidget {
  final String desc;
  final String icon;

  ATHMimeOrderDescItem(
      {this.desc = "Default", this.icon = "assets/icons/icon_trophy.svg"});

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: <Widget>[
          SvgPicture.asset(
            icon,
            width: kSize48,
          ),
          Text(
            desc,
            style: TextStyle(color: kColor33, fontSize: kFontSize26),
          )
        ],
      ),
    );
  }
}
